# !/usr/bin/env python
# coding=utf-8
# @Time    : 2018/7/15 6:10
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/rpc_dao.git
# @File    : DaoHandler.py
# @Software: PyCharm
# @Version: 2.7.5
from service import car_raw_info_service, car_insurance, insurance_types, open_order, \
	insurance_types_list, user_service, user_role_service, account_service, customer_service, \
	car_profile_service, car_types_service, insurance_query_service, insurance_query_cost_service, \
	insurance_order_service


class DaoHandler:
	def save_car_raw_info(self, info):
		car_raw_info_service.save_car_raw_info(info)

	def get_car_raw_info_by_license(self, license):
		return car_raw_info_service.get_car_raw_info_by_license(license)

	def get_car_raw_info_by_vin(self, vin):
		return car_raw_info_service.get_car_raw_info_by_vin(vin)

	def get_car_owner_info(self, vin, license):
		return car_raw_info_service.get_car_owner_info(vin, license)

	def update_car_raw_info(self, info, license):
		car_raw_info_service.update_car_raw_info(info, license)

	def update_car_owner_info(self, info, license, vin):
		car_raw_info_service.update_car_owner_info(info, license, vin)

	def add_car_insurance_info(self, info):
		car_insurance.add_car_insurance_info(info)

	def get_car_insurance_info(self, licenseNo, frameNo, engineNo):
		return car_insurance.get_car_insurance_info(licenseNo, frameNo, engineNo)

	def get_insurance_types(self):
		return insurance_types.get_insurance_types()

	def get_insurance_units(self, provinceCode, cityCode, appId):
		return insurance_types.get_insurance_units(provinceCode, cityCode, appId)

	def get_rate1(self, appId, cityCode, insuranceCode):
		return insurance_types.get_rate1(appId, cityCode, insuranceCode)

	def save_open_order(self, order, insurance, receiver):
		return open_order.save_open_order(order, insurance, receiver)

	def get_tpic_map(self):
		return insurance_types_list.get_tpic_map()

	def get_clpc_map(self):
		return insurance_types_list.get_clpc_map()

	def get_taic_map(self):
		return insurance_types_list.get_taic_map()

	def add_user(self, user_profile):
		return user_service.add_user(user_profile)

	def update_user(self, user_profile):
		return user_service.update_user(user_profile)

	def get_user_by_mobile(self, mobile):
		return user_service.get_user_by_mobile(mobile)

	def add_user_role(self, user_role):
		return user_role_service.add_user_role(user_role)

	def add_account(self, account):
		return account_service.add_account(account)

	def add_customer_info(self, info):
		return customer_service.add_customer_info(info)

	def get_customer_list(self, owner_id):
		return customer_service.get_customer_list(owner_id)

	def get_customer_info(self, owner_id, mobile, doc_code, customer_name):
		return customer_service.get_customer_info(owner_id, mobile, doc_code, customer_name)

	#car_profile
	def add_carprofile(self, car):
		return car_profile_service.add_car_profile(car)

	def get_carprofile(self, user_id, customer_id, license_no, vin_no, engine_no, register_date):
		return car_profile_service.get_carprofile(user_id, customer_id, license_no, vin_no, engine_no, register_date)

	def get_carfile_list(self, user_id, customer_id):
		return car_profile_service.get_carfile_list(user_id, customer_id)

	def get_carfile_license_no_list(self, user_id, customer_id, license_no):
		return car_profile_service.get_carfile_license_no_list(user_id, customer_id, license_no)

	# car_types
	def get_cartypes(self, brandCode):
		return car_types_service.get_car_types(brandCode)

	# ins_qry
	def add_ins_qry_list(self, ins_qry):
		return insurance_query_service.add_ins_qry_list(ins_qry)

	def get_ins_qry_list(self, user_id):
		return insurance_query_service.get_ins_qry_list(user_id)

	def get_ins_qry_list_Parms(self, user_id, biz_id):
		return insurance_query_service.get_ins_qry_list_Parms(user_id, biz_id)

	#
	def add_ins_cost_list(self, cost_list):
		return insurance_query_cost_service.add_ins_cost_list(cost_list)

	# insurance_order
	def add_insurance_order(self, order):
		return insurance_order_service.add_insurance_order(order)

	# insurance_order_cost
	def add_ins_order_cost(self, ins_order_list):
		pass

	# location
	def getProvince(self, gbCode):
		pass

	def getCity(self, gbCode):
		pass

	def getDistrict(self, gbCode):
		pass
